<template>
  <div class="rallyData">
    <!-- 头部搜索部分 -->
    <myHeader />
    <!-- 表单主体内容 -->
    <el-card class="box-card" shadow="never">
      <el-row >
        <el-col :span="6" :offset="22">
          <el-button type="primary" icon="el-icon-download">导出文件</el-button>
        </el-col>
      </el-row>
      <el-row >
        <dynTable
          ref="dynTable"
          :loading="tableLoading"
          :table-data="tableData"
          :table-columns="tableColumns"
        />
        <!--分页组件-->
        <pagination
          :total="total"
          :page.sync="listQuery.page"
          :limit.sync="listQuery.limit"
          @pagination="getList"
        />
      </el-row>
    </el-card>
  </div>
</template>

<script>
import myHeader from './components/header'
export default {
  name: 'RallyDataPage',
  components: {
    myHeader
  },
  filters: {
    statusFilter(status) {
      const statusMap = {
        true: 'true',
        false: 'false'
      }
      return statusMap[status]
    },
    typeFilter(type) {
      const statusMap = {
        true: 'success',
        false: 'danger'
      }
      return statusMap[type]
    }
  },
  data() {
    return {
      tableData: [],
      tableColumns: [
        { prop: '', label: '', type: 'selection' },
        { prop: '', label: this.$t('index'), type: 'index', width: '50px', templete: (_scope) => {
          return (
            <span>{ (this.listQuery.page - 1) * this.listQuery.size + _scope.$index + 1 }</span>
          )
        } },
        { prop: '', label: '拉力机名称' },
        { prop: '', label: '测试时间' },
        { prop: '', label: '系统时间' },
        { prop: '', label: '班次' },
        { prop: '', label: '客户名称' },
        { prop: '', label: '工单号' },
        { prop: '', label: '载带供应商' },
        { prop: '', label: '载带批' },
        { prop: '', label: '宽度' },
        { prop: '', label: '盖带供应商' },
        { prop: '', label: '盖带批' },
        { prop: '', label: '温度' },
        { prop: '', label: '压力' },
        { prop: '', label: '封合时间' },
        { prop: '', label: '剥离强度min' },
        { prop: '', label: '剥离强度max' },
        { prop: '', label: '平均值' },
        { prop: '', label: 'CPK' },
        { prop: '', label: '编带机名称' },
        { prop: 'result', label: '测试结果', slot: true },
        { prop: '', label: '操作员工号' },
        { prop: '', label: '封装形式' },
        { prop: '', label: '剥离时机' }
      ],
      total: 30,
      listQuery: {
        page: 1,
        size: 10
      },
      tableLoading: false
    }
  },
  methods: {
    scopedHandle(val) {
      this.dialogFormVisible = true
      console.log('接收到子组件的值', val)
      this.dialogForm = val
    },
    // 切换分页
    getList(val) {
      console.log(val)
    }
  }
}
</script>
